<?php
namespace Home\Controller;
use Think\Controller;
class TestkeyController extends Controller
{
    public function testkey_protocol(){
        $cata_id=isset($_POST['cata_id'])?trim($_POST['cata_id']):null;
        if(empty($cata_id)){
            $requset=array('returnCode'=>997,'returnMsg'=>'所请求数据信息不完整','returnData'=>null);
            echo json_encode($requset); exit;
        }else{
            $result=M('adsmanage')->where(['cat_id'=>$cata_id])->field('protocol')->find();
            if(empty($result)){
                $requset=array('returnCode'=>999,'returnMsg'=>'空数据','returnData'=>null);
                echo json_encode($requset); exist;
            }else{
                $requset=array('returnCode'=>0,'returnMsg'=>'成功','returnData'=>$result);
                echo json_encode($requset); exit;
            }
        }
    }
}